<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:o="http://openfaces.org/">

    <ui:composition template="/template.xhtml">
        <ui:define name="body">
            <h:form>
                <h:outputText value="#{bundle.CreateTicketTitle}" styleClass="titulo"></h:outputText>
                <br/>
                <h:panelGrid columns="3" styleClass="panel">
                    <h:outputLabel value="#{bundle.EditTicketLabel_ticketID}" for="ticketID" />
                    <h:inputText id="ticketID" value="#{ticketController.selected.ticketID}"
                                 title="#{bundle.EditTicketTitle_ticketID}" 
                                 required="#{ticketController.campoNulo('ticketID')}" 
                                 requiredMessage="#{bundle.EditTicketRequiredMessage_ticketID}"
                                 size="#{ticketController.longCampo('ticketID')}"
                                 maxlength="#{ticketController.longCampo('ticketID')}"/>
                    <h:message for="ticketID" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditTicketLabel_ticketPrice}" for="ticketPrice" />
                    <h:inputText id="ticketPrice" value="#{ticketController.selected.ticketPrice}"
                                 title="#{bundle.EditTicketTitle_ticketPrice}" 
                                 required="#{ticketController.campoNulo('ticketPrice')}" 
                                 requiredMessage="#{bundle.EditTicketRequiredMessage_ticketPrice}"
                                 size="#{ticketController.longCampo('ticketPrice')}"
                                 maxlength="#{ticketController.longCampo('ticketPrice')}"/>
                    <h:message for="ticketPrice" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditTicketLabel_userID}" for="userID" />
                    <h:selectOneMenu id="userID" value="#{ticketController.selected.userID}" title="#{bundle.EditTicketTitle_userID}" 
                                     required="true" requiredMessage="#{bundle.EditTicketRequiredMessage_userID}">                        <f:selectItems value="#{userController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:message for="userID" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditTicketLabel_seatshowtime}" for="seatshowtime" />
                    <h:selectOneMenu id="seatshowtime" value="#{ticketController.selected.seatshowtime}" title="#{bundle.EditTicketTitle_seatshowtime}" 
                                     required="true" requiredMessage="#{bundle.EditTicketRequiredMessage_seatshowtime}">                        <f:selectItems value="#{seatshowtimeController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:message for="seatshowtime" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditTicketLabel_purchaseID}" for="purchaseID" />
                    <h:selectOneMenu id="purchaseID" value="#{ticketController.selected.purchaseID}" title="#{bundle.EditTicketTitle_purchaseID}" 
                                     required="true" requiredMessage="#{bundle.EditTicketRequiredMessage_purchaseID}">                        <f:selectItems value="#{purchaseController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:message for="purchaseID" errorStyle="color: red" infoStyle="color: green"/>
                </h:panelGrid>
                <br />
                <h:commandButton action="#{ticketController.create}" value="Aceptar"/>
                <h:commandButton action="#{ticketController.prepareList}" value="Cancelar" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
